<template>
    <van-tree-select
            :items="items"
            :main-active-index="mainActiveIndex"
            :active-id="activeId"
            @navclick="onNavClick"
            @itemclick="onItemClick"
    />
</template>

<script>
    export default {
        name: "TreeSelecter",
        data(){
            return{
                items:[{
                        text: '作品类型5',
                        children: [
                            {text: '平面设计', id: 1,},
                            {text: '摄影', id: 2},
                            {text: '漫画', id: 3},
                            {text: '绘画', id: 4}
                            ]
                    }],
                mainActiveIndex: 0,
                activeId: 1
            }
        },
        methods: {
            onNavClick(index) {
                this.mainActiveIndex = index;
            },
            onItemClick(data) {
                this.activeId = data.id;
            }
        }


    }
</script>

<style scoped>

</style>